#ifndef QDATABASELOADER_H
#define QDATABASELOADER_H

#include "database_global.h"

#include <QString>
#include <QStringList>
#include <QMap>

struct tagPage
{
    QString                     m_name;
    QList<QStringList>          m_datas;
    QMap<QString,QStringList>   m_keyword_to_data;
};

class DATABASE_EXPORT QDataBaseLoader
{
public:
    QDataBaseLoader(int keyword_index);
    ~QDataBaseLoader();
    bool load(const QString &path);
    tagPage*    get_page(const QString &name);
    tagPage*    get_page(int index);

    int         get_page_count();

    QList<tagPage*> get_pages();
protected:
    QList<tagPage*>         m_pages;
    QMap<QString,tagPage*>  m_name_to_page;
    int                     m_keyword_index;
};

#endif // QDATABASELOADER_H
